'use strict';
import React, { useContext } from 'react';
import HttpContext from "../../server/httpContext";

const Status = ({ code, children }) => {
  let context = useContext(HttpContext);
  // 拿到在 server/utils内定义的context （src/server/utils.js）
  // 主要是做 404 页面
  context.staticContext.statuscode = code;
  return children
}

const Index = () => {

  return <Status code="404">
    <h1>大兄弟瞅啥呢</h1>
    <img id="img-404" src="/404.jpg" alt="" />
  </Status>
};

export default Index;